﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using DevExpress.XtraEditors.Repository;
using static DevExpress.XtraReports.Design.View.Office2003PaintHelper;
using System.Collections;
using DiaoPaiDaYin;
using DevExpress.XtraEditors.Popup;
using DevExpress.XtraGrid.Editors;
using DevExpress.Utils.Win;
using DevExpress.XtraLayout;
using DXApplicationTangche.UC.门店下单.DTO;
using DXApplicationTangche.DTO.坚山;
using DevExpress.XtraGrid.Demos.util;
using DXApplicationTangche.service;
using System.Diagnostics;
using DXApplicationTangche.UC.门店下单.下单;
using DXApplicationTangche.UC.订单一览新.订单预览新.service;
using DXApplicationTangche.UC.门店下单.service;
using DXApplicationTangche.UC.设计点;

namespace DXApplicationTangche.UC.门店下单.下单
{
    public partial class XtraUserControlC设计点 : DevExpress.XtraEditors.XtraUserControl
    {
        #region 属性
        private 设计点Model model设计点;
        public List<DTODesignPoints> Dto设计点s = new List<DTODesignPoints>();
        private GridEditorCollection gridEditors;
        #endregion
        #region 刺绣相关DTO
        public VO刺绣 vo刺绣字体 { get; set; } = new VO刺绣();
        public VO刺绣 vo刺绣颜色 { get; set; } = new VO刺绣();
        public VO刺绣 vo刺绣位置 { get; set; } = new VO刺绣();
        public VO刺绣 vo刺绣大小 { get; set; } = new VO刺绣();
        public VO刺绣 vo刺绣内容 { get; set; } = new VO刺绣(true);
        #endregion

        public XtraUserControlC设计点(String styleNameCn)
        {
            InitializeComponent();
            //  查询默认及可选设计点并绑定控件及数据源
            this.model设计点 = new 设计点Model(styleNameCn);
            this.Dto设计点s = this.model设计点.build原默认设计点().defaultDtoDesignPoints;
            this.gridEditors = new GridEditorCollection(this.model设计点.designPointsFacadeDTOs);
            this.gridControl设计点.DataSource = this.gridEditors;
        }
        public XtraUserControlC设计点 build坚山(String Style_Id)
        {
            //  查询默认及可选设计点并绑定控件及数据源
            this.model设计点 = new 设计点Model(Style_Id,true);
            this.Dto设计点s = this.model设计点.build原默认设计点().defaultDtoDesignPoints;
            this.gridEditors = new GridEditorCollection(this.model设计点.designPointsFacadeDTOs);
            this.gridControl设计点.DataSource = this.gridEditors;
            return this;
        }

        private void gridView1_CustomRowCellEdit(object sender, DevExpress.XtraGrid.Views.Grid.CustomRowCellEditEventArgs e)
        {
            if (e.Column == this.gridEditorValue)
            {
                GridEditorItem item = gridView设计点.GetRow(e.RowHandle) as GridEditorItem;
                if (item != null) e.RepositoryItem = item.RepositoryItem;
            }
        }
        private void gridView设计点_CustomDrawCell(object sender, DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs e)
        {
            try
            {
                if (e.Column.Name == "gridEditorName" || e.Column.Name == "gridEditorValue")
                {
                    if (this.Dto设计点s[e.RowHandle].optionValue != this.Dto设计点s[e.RowHandle].defaultValue)
                    {
                        e.Appearance.BackColor = Color.Red;
                    }
                }
            }
            catch (Exception ex)
            {

            }
        }

        public class GridEditorItem
        {
            string fName;
            object fValue;
            RepositoryItem fRepositoryItem;

            public GridEditorItem(RepositoryItem fRepositoryItem, string fName, object fValue)
            {
                this.fRepositoryItem = fRepositoryItem;
                this.fName = fName;
                this.fValue = fValue;
            }

            public GridEditorItem(DesignPointsFacadeDTO designPointsFacadeDTO) {
                this.fRepositoryItem = new RepositoryItemSearchLookUpEdit可选设计点(designPointsFacadeDTO);
                this.fName = designPointsFacadeDTO.defaultDtoDesignPoints.itemTypeNameCn;
                this.fValue = designPointsFacadeDTO.optionDtoDesignPoints;
            }
            public string Name { get { return this.fName; } }
            public object Value { get { return this.fValue; } set { this.fValue = value; } }
            public RepositoryItem RepositoryItem { get { return this.fRepositoryItem; } }
        }

        class GridEditorCollection : ArrayList
        {
            public GridEditorCollection()
            {
            }
            public new GridEditorItem this[int index] { get { return base[index] as GridEditorItem; } }
            public void Add(RepositoryItem fRepositoryItem, string fName, object fValue)
            {
                base.Add(new GridEditorItem(fRepositoryItem, fName, fValue));
            }
            public GridEditorCollection(List<DesignPointsFacadeDTO> designPointsFacadeDTOs)
            {
                foreach (DesignPointsFacadeDTO item in designPointsFacadeDTOs)
                {
                    this.Add(new GridEditorItem(item));
                }
            }
        }

        private void textBox刺绣内容_TextChanged(object sender, EventArgs e)
        {
            foreach (DTODesignPoints dto in Dto设计点s)
            {
                if ("4SMT".Equals(dto.itemValue))
                {
                    dto.optionValue = textBox刺绣内容.Text;
                    break;
                }
            }
            Dto设计点s.Add(new DTODesignPoints());
            this.vo刺绣内容.optionValue = textBox刺绣内容.Text;
            this.刺绣相关();
        }
        private void 刺绣相关()
        {
            //this.searchLookUpEdit刺绣字体.Properties.DataSource = new Model刺绣("4SMO", 订单预览新Service.get刺绣相关信息("4SMO")).vO刺绣s;
            //this.searchLookUpEdit刺绣颜色.Properties.DataSource = new Model刺绣("4SMC", 订单预览新Service.get刺绣相关信息("4SMC")).vO刺绣s;
            //this.searchLookUpEdit刺绣位置.Properties.DataSource = new Model刺绣("4SMP", 订单预览新Service.get刺绣相关信息("4SMP")).vO刺绣s;
            //this.searchLookUpEdit刺绣大小.Properties.DataSource = new Model刺绣("4SMS", 订单预览新Service.get刺绣相关信息("4SMS")).vO刺绣s;
            this.searchLookUpEdit刺绣字体.Properties.DataSource = new Model刺绣("4SMO", 订单预览新Service.get4SMCDesignOptionSSHIRT("4SMO")).vO刺绣s;
            this.searchLookUpEdit刺绣颜色.Properties.DataSource = new Model刺绣("4SMC", 订单预览新Service.get4SMCDesignOptionSSHIRT("4SMC")).vO刺绣s;
            this.searchLookUpEdit刺绣位置.Properties.DataSource = new Model刺绣("4SMP", 订单预览新Service.get4SMCDesignOptionSSHIRT("4SMP")).vO刺绣s;
            this.searchLookUpEdit刺绣大小.Properties.DataSource = new Model刺绣("4SMS", 订单预览新Service.get4SMCDesignOptionSSHIRT("4SMS")).vO刺绣s;
        }

        #region 选择刺绣字体
        /// <summary>
        /// 绑定清空事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void searchLookUpEdit刺绣字体_Popup(object sender, EventArgs e)
        {
            //得到当前SearchLookUpEdit弹出窗体
            PopupSearchLookUpEditForm form = (sender as IPopupControl).PopupWindow as PopupSearchLookUpEditForm;
            SearchEditLookUpPopup popup = form.Controls.OfType<SearchEditLookUpPopup>().FirstOrDefault();
            LayoutControl layout = popup.Controls.OfType<LayoutControl>().FirstOrDefault();
            //如果窗体内空间没有确认按钮，则自定义确认simplebutton，取消simplebutton，选中结果label
            if (layout.Controls.OfType<Control>().Where(ct => ct.Name == "btOK").FirstOrDefault() == null)
            {
                //得到空的空间
                EmptySpaceItem a = layout.Items.Where(it => it.TypeName == "EmptySpaceItem").FirstOrDefault() as EmptySpaceItem;

                //得到取消按钮，重写点击事件
                Control clearBtn = layout.Controls.OfType<Control>().Where(ct => ct.Name == "btClear").FirstOrDefault();
                LayoutControlItem clearLCI = (LayoutControlItem)layout.GetItemByControl(clearBtn);
                clearBtn.Click += clearBtn刺绣字体_Click;

                //添加一个simplebutton控件(确认按钮)
                LayoutControlItem myLCI = (LayoutControlItem)clearLCI.Owner.CreateLayoutItem(clearLCI.Parent);
                myLCI.TextVisible = false;
            }
        }
        /// <summary>
        /// 点击选择后的行为
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void searchLookUpEdit刺绣字体View_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
        {
            var a = this.searchLookUpEdit刺绣字体.Properties.View.GetSelectedRows();
            foreach (int rowHandle in a)
            {
                this.vo刺绣字体.itemCd = this.searchLookUpEdit刺绣字体.Properties.View.GetRowCellValue(rowHandle, "itemCd").ToString();
                this.vo刺绣字体.itemValue = this.searchLookUpEdit刺绣字体.Properties.View.GetRowCellValue(rowHandle, "itemValue").ToString();
                this.vo刺绣字体.optionValue = this.searchLookUpEdit刺绣字体.Properties.View.GetRowCellValue(rowHandle, "optionValue").ToString();
                this.vo刺绣字体.name = this.searchLookUpEdit刺绣字体.Properties.View.GetRowCellValue(rowHandle, "name").ToString();
                this.vo刺绣字体.itemTypeNameCn = this.searchLookUpEdit刺绣字体.Properties.View.GetRowCellValue(rowHandle, "itemTypeNameCn").ToString();
            }
            foreach (DTODesignPoints dto in Dto设计点s)
            {
                if ("4SMO".Equals(dto.itemValue))
                {
                    dto.name = FunctionHelper.GetgridViewValue(this.searchLookUpEdit刺绣字体.Properties.View, e.RowHandle, "name").ToString();
                    dto.optionValue = FunctionHelper.GetgridViewValue(this.searchLookUpEdit刺绣字体.Properties.View, e.RowHandle, "optionValue").ToString();
                    break;
                }
            }
        }
        /// <summary>
        /// 清除按钮事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void clearBtn刺绣字体_Click(object sender, EventArgs e)
        {
            this.searchLookUpEdit刺绣字体.ToolTip = null;
            searchLookUpEdit刺绣字体.EditValue = null;
        }
        /// <summary>
        /// 选完之后的显示
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void searchLookUpEdit刺绣字体_CustomDisplayText(object sender, DevExpress.XtraEditors.Controls.CustomDisplayTextEventArgs e)
        {
            if (null != e.Value)
            {
                foreach (DTODesignPoints dto in Dto设计点s)
                {
                    if ("4SMO".Equals(dto.itemValue))
                    {
                        e.DisplayText = dto.optionValue + ":" + dto.name;
                        break;
                    }
                    e.DisplayText = "";
                }
                e.DisplayText = this.vo刺绣字体.optionValue + ":" + this.vo刺绣字体.name;
                return;
            }
        }
        #endregion

        #region 选择刺绣颜色
        /// <summary>
        /// 绑定清空事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void searchLookUpEdit刺绣颜色_Popup(object sender, EventArgs e)
        {
            //得到当前SearchLookUpEdit弹出窗体
            PopupSearchLookUpEditForm form = (sender as IPopupControl).PopupWindow as PopupSearchLookUpEditForm;
            SearchEditLookUpPopup popup = form.Controls.OfType<SearchEditLookUpPopup>().FirstOrDefault();
            LayoutControl layout = popup.Controls.OfType<LayoutControl>().FirstOrDefault();
            //如果窗体内空间没有确认按钮，则自定义确认simplebutton，取消simplebutton，选中结果label
            if (layout.Controls.OfType<Control>().Where(ct => ct.Name == "btOK").FirstOrDefault() == null)
            {
                //得到空的空间
                EmptySpaceItem a = layout.Items.Where(it => it.TypeName == "EmptySpaceItem").FirstOrDefault() as EmptySpaceItem;

                //得到取消按钮，重写点击事件
                Control clearBtn = layout.Controls.OfType<Control>().Where(ct => ct.Name == "btClear").FirstOrDefault();
                LayoutControlItem clearLCI = (LayoutControlItem)layout.GetItemByControl(clearBtn);
                clearBtn.Click += clearBtn刺绣颜色_Click;

                //添加一个simplebutton控件(确认按钮)
                LayoutControlItem myLCI = (LayoutControlItem)clearLCI.Owner.CreateLayoutItem(clearLCI.Parent);
                myLCI.TextVisible = false;
            }
        }
        /// <summary>
        /// 点击选择后的行为
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void searchLookUpEdit刺绣颜色View_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
        {
            var a = this.searchLookUpEdit刺绣颜色.Properties.View.GetSelectedRows();
            foreach (int rowHandle in a)
            {
                this.vo刺绣颜色.itemCd = this.searchLookUpEdit刺绣颜色.Properties.View.GetRowCellValue(rowHandle, "itemCd").ToString();
                this.vo刺绣颜色.itemValue = this.searchLookUpEdit刺绣颜色.Properties.View.GetRowCellValue(rowHandle, "itemValue").ToString();
                this.vo刺绣颜色.optionValue = this.searchLookUpEdit刺绣颜色.Properties.View.GetRowCellValue(rowHandle, "optionValue").ToString();
                this.vo刺绣颜色.name = this.searchLookUpEdit刺绣颜色.Properties.View.GetRowCellValue(rowHandle, "name").ToString();
                this.vo刺绣颜色.itemTypeNameCn = this.searchLookUpEdit刺绣颜色.Properties.View.GetRowCellValue(rowHandle, "itemTypeNameCn").ToString();
            }
            foreach (DTODesignPoints dto in Dto设计点s)
            {
                if ("4SMC".Equals(dto.itemValue))
                {
                    dto.name = FunctionHelper.GetgridViewValue(this.searchLookUpEdit刺绣颜色.Properties.View, e.RowHandle, "name").ToString(); ;
                    dto.optionValue = FunctionHelper.GetgridViewValue(this.searchLookUpEdit刺绣颜色.Properties.View, e.RowHandle, "optionValue").ToString();
                    break;
                }
            }
        }
        /// <summary>
        /// 清除按钮事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void clearBtn刺绣颜色_Click(object sender, EventArgs e)
        {
            this.searchLookUpEdit刺绣颜色.ToolTip = null;
            searchLookUpEdit刺绣颜色.EditValue = null;
        }
        /// <summary>
        /// 选完之后的显示
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void searchLookUpEdit刺绣颜色_CustomDisplayText(object sender, DevExpress.XtraEditors.Controls.CustomDisplayTextEventArgs e)
        {
            if (null != e.Value)
            {
                foreach (DTODesignPoints dto in Dto设计点s)
                {
                    if ("4SMC".Equals(dto.itemValue))
                    {
                        e.DisplayText = dto.optionValue + ":" + dto.name;
                        break;
                    }
                    e.DisplayText = "";
                }
                e.DisplayText = this.vo刺绣颜色.optionValue + ":" + this.vo刺绣颜色.name;
                return;
            }
        }
        #endregion

        #region 选择刺绣位置
        /// <summary>
        /// 绑定清空事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void searchLookUpEdit刺绣位置_Popup(object sender, EventArgs e)
        {
            //得到当前SearchLookUpEdit弹出窗体
            PopupSearchLookUpEditForm form = (sender as IPopupControl).PopupWindow as PopupSearchLookUpEditForm;
            SearchEditLookUpPopup popup = form.Controls.OfType<SearchEditLookUpPopup>().FirstOrDefault();
            LayoutControl layout = popup.Controls.OfType<LayoutControl>().FirstOrDefault();
            //如果窗体内空间没有确认按钮，则自定义确认simplebutton，取消simplebutton，选中结果label
            if (layout.Controls.OfType<Control>().Where(ct => ct.Name == "btOK").FirstOrDefault() == null)
            {
                //得到空的空间
                EmptySpaceItem a = layout.Items.Where(it => it.TypeName == "EmptySpaceItem").FirstOrDefault() as EmptySpaceItem;

                //得到取消按钮，重写点击事件
                Control clearBtn = layout.Controls.OfType<Control>().Where(ct => ct.Name == "btClear").FirstOrDefault();
                LayoutControlItem clearLCI = (LayoutControlItem)layout.GetItemByControl(clearBtn);
                clearBtn.Click += clearBtn刺绣位置_Click;

                //添加一个simplebutton控件(确认按钮)
                LayoutControlItem myLCI = (LayoutControlItem)clearLCI.Owner.CreateLayoutItem(clearLCI.Parent);
                myLCI.TextVisible = false;
            }
        }
        /// <summary>
        /// 点击选择后的行为
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void searchLookUpEdit刺绣位置View_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
        {
            var a = this.searchLookUpEdit刺绣位置.Properties.View.GetSelectedRows();
            foreach (int rowHandle in a)
            {
                this.vo刺绣位置.itemCd = this.searchLookUpEdit刺绣位置.Properties.View.GetRowCellValue(rowHandle, "itemCd").ToString();
                this.vo刺绣位置.itemValue = this.searchLookUpEdit刺绣位置.Properties.View.GetRowCellValue(rowHandle, "itemValue").ToString();
                this.vo刺绣位置.optionValue = this.searchLookUpEdit刺绣位置.Properties.View.GetRowCellValue(rowHandle, "optionValue").ToString();
                this.vo刺绣位置.name = this.searchLookUpEdit刺绣位置.Properties.View.GetRowCellValue(rowHandle, "name").ToString();
                this.vo刺绣位置.itemTypeNameCn = this.searchLookUpEdit刺绣位置.Properties.View.GetRowCellValue(rowHandle, "itemTypeNameCn").ToString();
            }
            foreach (DTODesignPoints dto in Dto设计点s)
            {
                if ("4SMP".Equals(dto.itemValue))
                {
                    dto.name = FunctionHelper.GetgridViewValue(this.searchLookUpEdit刺绣位置.Properties.View, e.RowHandle, "name").ToString();
                    dto.optionValue = FunctionHelper.GetgridViewValue(this.searchLookUpEdit刺绣位置.Properties.View, e.RowHandle, "optionValue").ToString();
                    break;
                }
            }
        }
        /// <summary>
        /// 清除按钮事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void clearBtn刺绣位置_Click(object sender, EventArgs e)
        {
            this.searchLookUpEdit刺绣位置.ToolTip = null;
            searchLookUpEdit刺绣位置.EditValue = null;
        }
        /// <summary>
        /// 选完之后的显示
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void searchLookUpEdit刺绣位置_CustomDisplayText(object sender, DevExpress.XtraEditors.Controls.CustomDisplayTextEventArgs e)
        {
            if (null != e.Value)
            {
                foreach (DTODesignPoints dto in Dto设计点s)
                {
                    if ("4SMP".Equals(dto.itemValue))
                    {
                        e.DisplayText = dto.optionValue + ":" + dto.name;
                        break;
                    }
                    e.DisplayText = "";
                }
                e.DisplayText = this.vo刺绣位置.optionValue + ":" + this.vo刺绣位置.name;
                return;
            }
        }
        #endregion

        #region 选择刺绣大小
        /// <summary>
        /// 绑定清空事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void searchLookUpEdit刺绣大小_Popup(object sender, EventArgs e)
        {
            //得到当前SearchLookUpEdit弹出窗体
            PopupSearchLookUpEditForm form = (sender as IPopupControl).PopupWindow as PopupSearchLookUpEditForm;
            SearchEditLookUpPopup popup = form.Controls.OfType<SearchEditLookUpPopup>().FirstOrDefault();
            LayoutControl layout = popup.Controls.OfType<LayoutControl>().FirstOrDefault();
            //如果窗体内空间没有确认按钮，则自定义确认simplebutton，取消simplebutton，选中结果label
            if (layout.Controls.OfType<Control>().Where(ct => ct.Name == "btOK").FirstOrDefault() == null)
            {
                //得到空的空间
                EmptySpaceItem a = layout.Items.Where(it => it.TypeName == "EmptySpaceItem").FirstOrDefault() as EmptySpaceItem;

                //得到取消按钮，重写点击事件
                Control clearBtn = layout.Controls.OfType<Control>().Where(ct => ct.Name == "btClear").FirstOrDefault();
                LayoutControlItem clearLCI = (LayoutControlItem)layout.GetItemByControl(clearBtn);
                clearBtn.Click += clearBtn刺绣大小_Click;

                //添加一个simplebutton控件(确认按钮)
                LayoutControlItem myLCI = (LayoutControlItem)clearLCI.Owner.CreateLayoutItem(clearLCI.Parent);
                myLCI.TextVisible = false;
            }
        }
        /// <summary>
        /// 点击选择后的行为
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void searchLookUpEdit刺绣大小View_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
        {
            var a = this.searchLookUpEdit刺绣大小.Properties.View.GetSelectedRows();
            foreach (int rowHandle in a)
            {
                this.vo刺绣大小.itemCd = this.searchLookUpEdit刺绣大小.Properties.View.GetRowCellValue(rowHandle, "itemCd").ToString();
                this.vo刺绣大小.itemValue = this.searchLookUpEdit刺绣大小.Properties.View.GetRowCellValue(rowHandle, "itemValue").ToString();
                this.vo刺绣大小.optionValue = this.searchLookUpEdit刺绣大小.Properties.View.GetRowCellValue(rowHandle, "optionValue").ToString();
                this.vo刺绣大小.name = this.searchLookUpEdit刺绣大小.Properties.View.GetRowCellValue(rowHandle, "name").ToString();
                this.vo刺绣大小.itemTypeNameCn = this.searchLookUpEdit刺绣大小.Properties.View.GetRowCellValue(rowHandle, "itemTypeNameCn").ToString();
            }
            foreach (DTODesignPoints dto in Dto设计点s)
            {
                if ("4SMS".Equals(dto.itemValue))
                {
                    dto.name = FunctionHelper.GetgridViewValue(this.searchLookUpEdit刺绣大小.Properties.View, e.RowHandle, "name").ToString();
                    dto.optionValue = FunctionHelper.GetgridViewValue(this.searchLookUpEdit刺绣大小.Properties.View, e.RowHandle, "optionValue").ToString();
                    break;
                }
            }
        }
        /// <summary>
        /// 清除按钮事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void clearBtn刺绣大小_Click(object sender, EventArgs e)
        {
            this.searchLookUpEdit刺绣大小.ToolTip = null;
            searchLookUpEdit刺绣大小.EditValue = null;
        }
        /// <summary>
        /// 选完之后的显示
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void searchLookUpEdit刺绣大小_CustomDisplayText(object sender, DevExpress.XtraEditors.Controls.CustomDisplayTextEventArgs e)
        {
            if (null != e.Value)
            {
                foreach (DTODesignPoints dto in Dto设计点s)
                {
                    if ("4SMS".Equals(dto.itemValue))
                    {
                        e.DisplayText = dto.optionValue + ":" + dto.name;
                        break;
                    }
                    e.DisplayText = "";
                }
                e.DisplayText = this.vo刺绣大小.optionValue + ":" + this.vo刺绣大小.name;
                return;
            }
        }
        #endregion
        
    }
    public class 设计点Model
    {
        public List<DesignPointsFacadeDTO> designPointsFacadeDTOs = new List<DesignPointsFacadeDTO>();
        public List<DTODesignPoints> defaultDtoDesignPoints = new List<DTODesignPoints>();
        public 设计点Model(String styleNameCn)
        {
            //查询设计点
            this.designPointsFacadeDTOs = 下单相关Service.getDesignPointsFacadeByStyleName(styleNameCn);
        }
        public 设计点Model(String styleNameCn,Boolean is坚山)
        {
            //查询设计点
            this.designPointsFacadeDTOs = 下单相关Service.getStyleDesignById(styleNameCn);
            //for (int i = this.designPointsFacadeDTOs.Count - 1; i > 0; i--)
            //{
            //    if (this.designPointsFacadeDTOs[i].defaultDtoDesignPoints.itemTypeNameCn.Contains("刺绣"))
            //    {
            //        this.designPointsFacadeDTOs.Remove(this.designPointsFacadeDTOs[i]);
            //    }
            //}
        }
        public 设计点Model build原默认设计点()
        {
            foreach (DesignPointsFacadeDTO item in this.designPointsFacadeDTOs)
            {
                this.defaultDtoDesignPoints.Add(item.defaultDtoDesignPoints);
            }
            return this;
        }
    }
}
